#include<iostream>
#include<cstring>

using namespace std;

int main() {
    char A[1000], B[1000];
    int a, b, c;
    cin >> A >> B >> c;
    a = A[strlen(A) - 1] - '0';
    b = B[strlen(B) - 1] - '0';
    if ((a + b) % 10 == c) {
        cout << "YES";
    } else {
        cout << "NO";
    }

    return 0;
}